package com.qy127.controller;

import com.qy127.dao.TypeDao;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/type")
public class TypeController {

    /**
     *注入typeDao 接口
     */
    @Resource(name = "typeDaoImpl")
    private TypeDao typeDao;

    /**
     * 查询所有书籍类型
     * @return
     */
    @RequestMapping("/selectType")
    public @ResponseBody List<Map<String,Object>> selType(){
        List<Map<String, Object>> allType = typeDao.getAllType();
        //System.out.println(allType);
        return allType;

    }


}
